package demo18System类;

import java.util.Arrays;

public class Demo12 {
    public static void main(String[] args) {
        //1. arrarycopy;数组的复制
        //src:复制的原数组
        //srcPos:从那个位置开始复制0
        //dest:目标数组
        //destPos:目标数组的位置
        //length:复制的长度
        int[] arr = {20,18,15,8,35,26,45,90};
        int[] dest = new int[8];
        System.arraycopy(arr,4 ,dest ,4,4);

        for (int i:dest) {
            System.out.println(i);
        }

        //Arrays.copyOf(original,newLength)

        //2.获取毫秒数
        System.out.println(System.currentTimeMillis());

        long start = System.currentTimeMillis();
        for (int i = 0; i < 9999; i ++){
            for(int j = 0; j < 9999; j ++){
                int result = i + j;
            }
        }
        long end = System.currentTimeMillis();
        System.out.println("用时:" + (end - start));

        new Student("aaa", 19);
        new Student("bbb", 19);
        new Student("ccc", 19);

        //3.回收垃圾
        System.gc();//告诉垃圾回收器回收

        //4.退出jvm
        System.exit(0);

        System.out.println("程序结束了......");

    }
}
